package com.springDemo.AOP.proxy;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;

/**
 * Created by Administrator on 2016/7/11.
 */
public class PayDynamicProxyByJDK implements InvocationHandler{

    private  Object obj;

    public PayDynamicProxyByJDK(Object obj){
        super();
        this.obj = obj;
    }

    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("支付操作前日志记录");
        Object methodObj = method.invoke(this.obj,args);
        System.out.println("支付操作后日志记录");
        return methodObj;
    }
}
